package com.xinghou.platform.server.api.controller;

import com.xinghou.platform.service.main.StatisticsService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.SessionAttributes;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * Created by qingshengzheng on 16/6/23.
 */
@Controller
@SessionAttributes("token")
public class StatisticsController extends  BaseControl {
    @Resource
    public StatisticsService statisticsService;
    /* Wap 点击数
     * @param subjectReq
     * @param request
     * @param response
     * @return
     */
    @ResponseBody
    @RequestMapping(value = "/wapClickCount")
    public String wapClickCount(HttpServletRequest request, HttpServletResponse response) {
        statisticsService.wapClickCount();
        return response(null);
    }

    /* download按钮 点击数
    * @param subjectReq
    * @param request
    * @param response
    * @return
    */
    @ResponseBody
    @RequestMapping(value = "/downloadClickCount")
    public String downloadClickCount(HttpServletRequest request, HttpServletResponse response) {
        statisticsService.downloadClickCount();
        return response(null);
    }

}
